3.465 \(\int \sec ^6(c+d x) (a+i a \tan (c+d x))^n \, dx\)

Optimal. Leaf size=97 \[ -\frac{4 i (a+i a \tan (c+d x))^{n+3}}{a^3 d (n+3)}+\frac{4 i (a+i a \tan (c+d x))^{n+4}}{a^4 d (n+4)}-\frac{i (a+i a \tan (c+d x))^{n+5}}{a^5 d (n+5)} \]

[Out]

((-4*I)*(a + I*a*Tan[c + d*x])^(3 + n))/(a^3*d*(3 + n)) + ((4*I)*(a + I*a*Tan[c + d*x])^(4 + n))/(a^4*d*(4 + n
)) - (I*(a + I*a*Tan[c + d*x])^(5 + n))/(a^5*d*(5 + n))

________________________________________________________________________________________

Rubi [A]  time = 0.0696611, antiderivative size = 97, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.083, Rules used = {3487, 43} \[ -\frac{4 i (a+i a \tan (c+d x))^{n+3}}{a^3 d (n+3)}+\frac{4 i (a+i a \tan (c+d x))^{n+4}}{a^4 d (n+4)}-\frac{i (a+i a \tan (c+d x))^{n+5}}{a^5 d (n+5)} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^6*(a + I*a*Tan[c + d*x])^n,x]

[Out]

((-4*I)*(a + I*a*Tan[c + d*x])^(3 + n))/(a^3*d*(3 + n)) + ((4*I)*(a + I*a*Tan[c + d*x])^(4 + n))/(a^4*d*(4 + n
)) - (I*(a + I*a*Tan[c + d*x])^(5 + n))/(a^5*d*(5 + n))

Rule 3487

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

\begin{align*} \int \sec ^6(c+d x) (a+i a \tan (c+d x))^n \, dx &=-\frac{i \operatorname{Subst}\left (\int (a-x)^2 (a+x)^{2+n} \, dx,x,i a \tan (c+d x)\right )}{a^5 d}\\ &=-\frac{i \operatorname{Subst}\left (\int \left (4 a^2 (a+x)^{2+n}-4 a (a+x)^{3+n}+(a+x)^{4+n}\right ) \, dx,x,i a \tan (c+d x)\right )}{a^5 d}\\ &=-\frac{4 i (a+i a \tan (c+d x))^{3+n}}{a^3 d (3+n)}+\frac{4 i (a+i a \tan (c+d x))^{4+n}}{a^4 d (4+n)}-\frac{i (a+i a \tan (c+d x))^{5+n}}{a^5 d (5+n)}\\ \end{align*}

Mathematica [A]  time = 14.1055, size = 171, normalized size = 1.76 \[ -\frac{i 2^{n+5} e^{6 i (c+d x)} \left (e^{i d x}\right )^n \left (\frac{e^{i (c+d x)}}{1+e^{2 i (c+d x)}}\right )^n \left (2 (n+5) e^{2 i (c+d x)}+2 e^{4 i (c+d x)}+n^2+9 n+20\right ) \sec ^{-n}(c+d x) (\cos (d x)+i \sin (d x))^{-n} (a+i a \tan (c+d x))^n}{d (n+3) (n+4) (n+5) \left (1+e^{2 i (c+d x)}\right )^5} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^6*(a + I*a*Tan[c + d*x])^n,x]

[Out]

((-I)*2^(5 + n)*E^((6*I)*(c + d*x))*(E^(I*d*x))^n*(E^(I*(c + d*x))/(1 + E^((2*I)*(c + d*x))))^n*(20 + 2*E^((4*
I)*(c + d*x)) + 9*n + n^2 + 2*E^((2*I)*(c + d*x))*(5 + n))*(a + I*a*Tan[c + d*x])^n)/(d*(1 + E^((2*I)*(c + d*x
)))^5*(3 + n)*(4 + n)*(5 + n)*Sec[c + d*x]^n*(Cos[d*x] + I*Sin[d*x])^n)

________________________________________________________________________________________

Maple [C]  time = 0.577, size = 3316, normalized size = 34.2 \begin{align*} \text{output too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^6*(a+I*a*tan(d*x+c))^n,x)

[Out]

-32*I/(3+n)/d/(5+n)/(4+n)/(exp(2*I*(d*x+c))+1)^5*(2*a^n*2^n*(exp(I*(Re(d*x)+Re(c)))^n)^2/((exp(2*I*(d*x+c))+1)
^n)*exp(-2*n*Im(d*x)-2*n*Im(c))*exp(1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c)
)+1))^2*n)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(
d*x+c)))*csgn(I*a)*n)*exp(1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*csgn(I/(exp(2*I*(d*x+c))+1)
)*n)*exp(1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c))
)^2*n)*exp(1/2*I*Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*csgn(I*a)*n)*exp(-1/2*I*Pi*csgn(I*a/(exp
(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^3*n)*exp(10*I*d*x)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(I*(d*x
+c)))^2*n)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I/(exp(2*
I*(d*x+c))+1))*n)*exp(10*I*c)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))^3*n)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)
)/(exp(2*I*(d*x+c))+1))^3*n)*exp(I*Pi*csgn(I*exp(2*I*(d*x+c)))^2*csgn(I*exp(I*(d*x+c)))*n)+2*a^n*2^n*(exp(I*(R
e(d*x)+Re(c)))^n)^2/((exp(2*I*(d*x+c))+1)^n)*n*exp(-2*n*Im(d*x)-2*n*Im(c))*exp(1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)
))*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*n)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+
1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))*csgn(I*a)*n)*exp(1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I
*(d*x+c))+1))^2*csgn(I/(exp(2*I*(d*x+c))+1))*n)*exp(1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csg
n(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*n)*exp(1/2*I*Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))
^2*csgn(I*a)*n)*exp(-1/2*I*Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^3*n)*exp(8*I*d*x)*exp(-1/2*I*Pi*
csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(I*(d*x+c)))^2*n)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*
x+c))/(exp(2*I*(d*x+c))+1))*csgn(I/(exp(2*I*(d*x+c))+1))*n)*exp(8*I*c)*exp(-1/2*I*Pi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*(exp(I*(Re(d*x)+Re(c)))^n)^2/((exp(2*I*(d*x+c))+1)^n)*n*exp(-2*n*Im(d*x)-2*n*Im(c))*exp(1/2*I*Pi*csgn(I*exp
(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*n)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2
*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))*csgn(I*a)*n)*exp(1/2*I*Pi*csgn(I*exp(2*I*(d*x+
c))/(exp(2*I*(d*x+c))+1))^2*csgn(I/(exp(2*I*(d*x+c))+1))*n)*exp(1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x
+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*n)*exp(1/2*I*Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2
*I*(d*x+c)))^2*csgn(I*a)*n)*exp(-1/2*I*Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^3*n)*exp(6*I*d*x)*ex
p(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(I*(d*x+c)))^2*n)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I
*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I/(exp(2*I*(d*x+c))+1))*n)*exp(6*I*c)*exp(-1/2*I*Pi*csgn(I*exp(2*
I*(d*x+c)))^3*n)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^3*n)*exp(I*Pi*csgn(I*exp(2*I*(d*x
+c)))^2*csgn(I*exp(I*(d*x+c)))*n)+20*a^n*2^n*(exp(I*(Re(d*x)+Re(c)))^n)^2/((exp(2*I*(d*x+c))+1)^n)*exp(-2*n*Im
(d*x)-2*n*Im(c))*exp(1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*n)*exp(
-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))*csgn(I
*a)*n)*exp(1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*csgn(I/(exp(2*I*(d*x+c))+1))*n)*exp(1/2*I*
Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*n)*exp(1/2*
I*Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*csgn(I*a)*n)*exp(-1/2*I*Pi*csgn(I*a/(exp(2*I*(d*x+c))+1
)*exp(2*I*(d*x+c)))^3*n)*exp(6*I*d*x)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(I*(d*x+c)))^2*n)*exp(-
1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I/(exp(2*I*(d*x+c))+1))*n
)*exp(6*I*c)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))^3*n)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c
))+1))^3*n)*exp(I*Pi*csgn(I*exp(2*I*(d*x+c)))^2*csgn(I*exp(I*(d*x+c)))*n))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^6*(a+I*a*tan(d*x+c))^n,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.20734, size = 686, normalized size = 7.07 \begin{align*} \frac{{\left ({\left (-64 i \, n - 320 i\right )} e^{\left (8 i \, d x + 8 i \, c\right )} +{\left (-32 i \, n^{2} - 288 i \, n - 640 i\right )} e^{\left (6 i \, d x + 6 i \, c\right )} - 64 i \, e^{\left (10 i \, d x + 10 i \, c\right )}\right )} \left (\frac{2 \, a e^{\left (2 i \, d x + 2 i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{n}}{d n^{3} + 12 \, d n^{2} + 47 \, d n +{\left (d n^{3} + 12 \, d n^{2} + 47 \, d n + 60 \, d\right )} e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \,{\left (d n^{3} + 12 \, d n^{2} + 47 \, d n + 60 \, d\right )} e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \,{\left (d n^{3} + 12 \, d n^{2} + 47 \, d n + 60 \, d\right )} e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \,{\left (d n^{3} + 12 \, d n^{2} + 47 \, d n + 60 \, d\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \,{\left (d n^{3} + 12 \, d n^{2} + 47 \, d n + 60 \, d\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + 60 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^6*(a+I*a*tan(d*x+c))^n,x, algorithm="fricas")

[Out]

((-64*I*n - 320*I)*e^(8*I*d*x + 8*I*c) + (-32*I*n^2 - 288*I*n - 640*I)*e^(6*I*d*x + 6*I*c) - 64*I*e^(10*I*d*x
+ 10*I*c))*(2*a*e^(2*I*d*x + 2*I*c)/(e^(2*I*d*x + 2*I*c) + 1))^n/(d*n^3 + 12*d*n^2 + 47*d*n + (d*n^3 + 12*d*n^
2 + 47*d*n + 60*d)*e^(10*I*d*x + 10*I*c) + 5*(d*n^3 + 12*d*n^2 + 47*d*n + 60*d)*e^(8*I*d*x + 8*I*c) + 10*(d*n^
3 + 12*d*n^2 + 47*d*n + 60*d)*e^(6*I*d*x + 6*I*c) + 10*(d*n^3 + 12*d*n^2 + 47*d*n + 60*d)*e^(4*I*d*x + 4*I*c)
+ 5*(d*n^3 + 12*d*n^2 + 47*d*n + 60*d)*e^(2*I*d*x + 2*I*c) + 60*d)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**6*(a+I*a*tan(d*x+c))**n,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right )^{6}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^6*(a+I*a*tan(d*x+c))^n,x, algorithm="giac")

[Out]

integrate((I*a*tan(d*x + c) + a)^n*sec(d*x + c)^6, x)